import http from '@/utils/request'

/**
 * 获取部门列表数据
 */
export const reqGetDepartments = () => http({
  method: 'get',
  url: '/company/department'
})

export const reqDelDepartment = (id) => http({
  method: 'delete',
  url: `/company/department/${id}`
})

/**
 * 新增部门
 */
export const reqAddDepartment = (data) => {
  return http({
    method: 'post',
    url: '/company/department',
    data
  })
}

/**
 * 根据id查询部门状态
 */
export const reqGetDepartDetail = (id) => {
  return http({
    method: 'get',
    url: `/company/department/${id}`
  })
}

/**
 * 根据id修改部门详情
 */
export const reqUpdateDepartDetail = (form) => {
  return http({
    method: 'put',
    url: `/company/department/${form.id}`,
    data: form
  })
}
